using UnityEngine;
using QFramework;

namespace ProjectSurvivor
{
    public partial class FXController : ViewController
    {
        public static FXController mDefault;
        private void Awake()
        {
            mDefault = this;
        }

        private void OnDestroy()
        {
            mDefault = null;
        }

        public static void Play(SpriteRenderer sprite,Color dissolveColor)
        {
            mDefault.EnemyDieFx.Instantiate().Position(sprite.Position()).LocalScale(sprite.Scale())
                .Self((self)=>
                {
                    self.GetComponent<Dissolve>().DissolveColor = dissolveColor;
                    self.sprite = sprite.sprite;
                }).Show();
        }
    }
}
